package Thread;

public class ThreadDemo3 {
    private static boolean flag = true;
    public static void main(String[] args) {

        Thread t = new Thread(() -> {
            long start = System.currentTimeMillis();
            while (flag) {
                System.out.println("hello");
            }
            long stop = System.currentTimeMillis();
            System.out.println(stop-start);
        });
        t.start();
        flag = false;
    }
}
